
*Replication material for:
*Bringing party organization back in: A comparative analysis of party representation in Europe

*Nathalie Giger and Gijs Schumacher

****************************
*load  dataset

use "Dataset for Giger_Schumacher2019.dta", clear

*Replication of tables in the study

*Table 2
xtmixed relcit q21  pervote incumbent foundation  rile_dummy || country:
xtmixed relcit  lll pervote incumbent foundation  rile_dummy || country:
xtmixed relcit q21 lll pervote incumbent foundation  rile_dummy || country:

*Table 3
xtmixed distance_a q21 lll pervote incumbent foundation  rile_dummy || country: 
xtmixed subjcong q21 lll pervote incumbent foundation  rile_dummy || country:  
xtmixed absmean_distance q21  pervote incumbent foundation  rile_dummy || country: 
xtmixed partystd lll pervote incumbent foundation  rile_dummy || country: if e(sample) 


********************************************************************************

*Supplementary Material
*********************************************************************************

*Table with descriptives  (table 1)
sum relcit distance_a subjcong absmean_distance partystd q21 lll pervote incumbent foundation rile_dummy if e(sample)

*Figure 1 (two dimensional scatter with CMP)
scatter lll q21, mlabel(partyvote) ytitle(vertical integration) xtitle(horizontal integration)

*Table 2 (empty model)
xtmixed relcit  || country:  , var nolog


*Table 3 (with party positions from highly educated only)
xtmixed relcit_edu q21 lll pervote incumbent foundation  rile_dummy || country:
xtmixed distance_a_edu q21 lll pervote incumbent foundation  rile_dummy || country: 
xtmixed absmean_distance_edu q21  pervote incumbent foundation  rile_dummy || country: 

*Table 4 (without niche parties)
xtmixed relcit q21 lll foundation incumbent pervote || country: if rile_dummy==0
xtmixed distance_a q21 lll foundation incumbent pervote || country: if rile_dummy==0
xtmixed subjcong q21 lll pervote incumbent foundation  || country:  if rile_dummy==0 
xtmixed absmean_distance q21  pervote incumbent foundation   || country: if rile_dummy==0 
xtmixed partystd lll pervote incumbent foundation  || country: if e(sample) & rile_dummy==0 

*Table 5 (interaction models)
xtmixed relcit c.q21##c.lll pervote incumbent foundation  rile_dummy|| country:
xtmixed distance_a  c.q21##c.lll pervote incumbent foundation  rile_dummy|| country:
xtmixed subjcong  c.q21##c.lll pervote incumbent foundation  rile_dummy || country:

*Table 6 (categorical interaction models)
sum lll
gen leaderdom1=1 if lll>=r(mean)
replace leaderdom1=0 if lll<r(mean)
replace leaderdom1=. if lll==.

sum q21
gen massdom=1 if q21>=r(mean)
replace massdom=0 if q21<r(mean)
replace massdom=. if q21==.

xtmixed relcit  i.massdom##i.leaderdom1 pervote incumbent foundation  rile_dummy || country:
xtmixed distance_a i.massdom##i.leaderdom1 pervote incumbent foundation  rile_dummy || country:
xtmixed subjcong  i.massdom##i.leaderdom1 pervote incumbent foundation  rile_dummy || country: 

*Table 7 (elections instead of countries as higher level)
xtmixed relcit q21 lll pervote incumbent foundation  rile_dummy || B1003:
xtmixed distance_a q21 lll pervote incumbent foundation  rile_dummy || B1003:
xtmixed subjcong q21 lll pervote incumbent foundation  rile_dummy || B1003:
xtmixed absmean_distance q21  pervote incumbent foundation  rile_dummy || B1003:
xtmixed partystd lll pervote incumbent foundation rile_dummy ||B1003: if e(sample) 

*Table 8 (party constants as another higher level)
xtmixed relcit q21 lll pervote incumbent foundation  rile_dummy || country: || partyvote:
xtmixed distance_a q21 lll pervote incumbent foundation  rile_dummy || country: || partyvote:
xtmixed subjcong q21 lll pervote incumbent foundation  rile_dummy || country: || partyvote:
xtmixed absmean_distance q21  pervote incumbent foundation  rile_dummy || country: || partyvote:
xtmixed partystd lll pervote incumbent foundation rile_dummy || country: || partyvote: if e(sample) 


*Table 9 (fixed effects)
tab country, gen (country_)
xtmixed relcit q21  pervote incumbent foundation  rile_dummy country_1-country_14
xtmixed relcit  lll pervote incumbent foundation  rile_dummy country_1-country_14
xtmixed relcit q21 lll pervote incumbent foundation  rile_dummy country_1-country_14



